package com.ecode.job.controller;

import com.ecode.job.domain.TestParams;
import com.xxl.job.core.biz.model.ReturnT;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RestController
@EnableAutoConfiguration
public class IndexController {

    @GetMapping("/")
    public ReturnT<Object> index() {
        System.out.println(1111);
        System.out.println("=============================");
        return new ReturnT(HttpStatus.OK.value(),HttpStatus.OK.getReasonPhrase());
    }

    @PostMapping("/testPostParams")
    public ReturnT<Object> testPostParams(@RequestBody TestParams TestParams) {
        log.info(TestParams.toString());
        return new ReturnT(HttpStatus.OK.value(),HttpStatus.OK.getReasonPhrase());
    }

    @GetMapping("/testGetParams/{msg}")
    public ReturnT<Object> testGetParams(@PathVariable String msg) {
        log.info(msg);
        return new ReturnT(HttpStatus.OK.value(),HttpStatus.OK.getReasonPhrase());
    }

}